function Imageserialize(obj) {
		
		this.ipt   = $(obj.ipt);
		this.pre   = $(obj.pre);
		
		this.width  = parseInt(obj.width);
		this.height = parseInt(obj.height);
		
		return this;
	}
	
	Imageserialize.prototype = {
		init: function(path) {
			var self = this;
			 lrz(path).then(function (rst) {
				 var image = new Image();
				 image.src = rst.base64;
				 self.ipt.val(rst.base64);
				 self.load(image);
			 });
		},
		
		load: function(image) {
			var self = this;
			 image.onload = function () {
				self.resize(image);
	            self.pre.empty().append(image);
	         };
	         return this;
		},
		
		resize: function(image) {
			var self = this, w = self.width, h = self.height;
			if (image.width > 0 && image.height > 0) {
                if (image.width / image.height >= w / h) {
                    if (image.width > w) {
                    	image.height = (image.height * w) / image.width;
                    	image.width = w;
                    } else {
                    	image.width = image.width;
                    	image.height = image.height;
                    }
                } else {
                    if (image.height > h) {
                    	image.width = (image.width * w) / image.height;
                    	image.height = h;
                    } else {
                    	image.width = image.width;
                    	image.height = image.height;
                    }
                }
            }
			
			return image;
		}
	}